<template>
  <div class="book-title-content">
    <h1 class="title">{{ title }}</h1>
    <div class="learn-more" v-if="learnMore">
      <span>/</span>
      <router-link class="learn-more-link" :to="{path: learnMore.path || '#'}">
        {{ learnMore.title || "更多" }}
      </router-link>
    </div>
    <div class="share-links" v-if="shareData">
      <router-link class="share-link-item" v-for="(item, index) in shareData" :key="index" :to="{path: item.path || '#'}">
        {{ item.title || "" }}
      </router-link>
    </div>
  </div>
</template>

<script>
export default {
  name: 'bookTitle',
  props: {
    title: {
      type: String,
      default: ''
    },
    learnMore: {
      type: [Object, Boolean]
    },
    shareData: {
      type: [Array, Boolean]
    }
  }
}
</script>

<style lang="scss" scope>
  .book-title-content {
    display: flex;
    flex-direction: row;
    border-bottom: 1px solid #AFAFAF;
    .title {
      margin: 0;
      padding: 0;
      font-size: 18px;
      font-weight: 700;
      line-height: 50px;
    }
    .learn-more {
      margin: 0 5px;
      .learn-more-link {
        margin-left: 5px;
        line-height: 50px;
        color: #365899;
        text-decoration: none;
        font-size: 12px;
        &:hover {
          color: #8C222C;
        }
      }
    }
    .share-links {
      margin: 0 10px;
      font-size: 14px;
      line-height: 50px;
      .share-link-item {
        text-decoration: none;
        color: #365899;
        margin-left: 5px;
        &:hover {
          color: #8C222C;
        }
      }
    }
  }
</style>
